package com.ruoyi.borrow.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户信息表
 * @TableName tb_user_information
 */
@TableName(value ="tb_user_information")
@Data
public class UserInformation implements Serializable {
    /**
     * 用户id（user_id）
     */
    private Integer id;

    /**
     * 用户姓名（realname）
     */
    private String realname;

    /**
     * 手机号（mobile）
     */
    private String mobile;

    /**
     * 身份证号（id_card）
     */
    private String idCard;

    /**
     * 银行卡号（brand_card)
     */
    private String brandCard;

    /**
     * 信额（credit）
     */
    private Integer credit;

    /**
     * 用户邮箱（user_email）
     */
    private String userEmail;

    /**
     * 额度
     */
    private Integer quota;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserInformation other = (UserInformation) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getRealname() == null ? other.getRealname() == null : this.getRealname().equals(other.getRealname()))
            && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
            && (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
            && (this.getBrandCard() == null ? other.getBrandCard() == null : this.getBrandCard().equals(other.getBrandCard()))
            && (this.getCredit() == null ? other.getCredit() == null : this.getCredit().equals(other.getCredit()))
            && (this.getUserEmail() == null ? other.getUserEmail() == null : this.getUserEmail().equals(other.getUserEmail()))
            && (this.getQuota() == null ? other.getQuota() == null : this.getQuota().equals(other.getQuota()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRealname() == null) ? 0 : getRealname().hashCode());
        result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
        result = prime * result + ((getIdCard() == null) ? 0 : getIdCard().hashCode());
        result = prime * result + ((getBrandCard() == null) ? 0 : getBrandCard().hashCode());
        result = prime * result + ((getCredit() == null) ? 0 : getCredit().hashCode());
        result = prime * result + ((getUserEmail() == null) ? 0 : getUserEmail().hashCode());
        result = prime * result + ((getQuota() == null) ? 0 : getQuota().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", realname=").append(realname);
        sb.append(", mobile=").append(mobile);
        sb.append(", idCard=").append(idCard);
        sb.append(", brandCard=").append(brandCard);
        sb.append(", credit=").append(credit);
        sb.append(", userEmail=").append(userEmail);
        sb.append(", quota=").append(quota);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}